package com.tarena.lbs.basic.web.controller;

import com.tarena.lbs.base.protocol.model.Result;
import com.tarena.lbs.basic.web.service.TagService;
import com.tarena.lbs.pojo.basic.vo.TagVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class TagController {
    @Autowired
    private TagService tagService;
    //查询文章绑定的标签
    @GetMapping("/basic/tagLibrary/info/article/tags")
    public Result<Map<String, List<TagVO>>> getArticleTags(){
        return new Result<>(tagService.getTags(0));
    }
    //查询用户可见的所有标签 兴趣爱好的数据
    @GetMapping("/basic/tagLibrary/info/userList")
    public Result<Map<String,List<TagVO>>> getUserTags(){
        return new Result<>(tagService.getTags(1));
    }
}
